#ifndef _RSA_VERIFY_H_
#define _RSA_VERIFY_H_

#define GET_DWORD(i)                    (*(volatile UINT32 *)(i))

#define HMAC_OUT_LENGTH   32
#define HASH_BLOCK_LENGTH   64
#define FIRST_KEY_LENGTH   16
typedef struct hmac_param
{
    UINT8 key[FIRST_KEY_LENGTH];
    UINT8 k0[HASH_BLOCK_LENGTH];
    UINT8 ipad[HASH_BLOCK_LENGTH];
    UINT8 opad[HASH_BLOCK_LENGTH];
    UINT8 hout[HASH_BLOCK_LENGTH];
}HMAC_PARAM, *PHMAC_PARAM;

typedef enum 
{
    PK_FROM_FLASH = 0,
    PK_FROM_OTP,
}PK_POS;

void bl_generate_store_key_for_pvr();
void sw_generate_store_key_for_pvr();
RET_CODE cipher_get_chunk_len(UINT32 id, UINT32 *addr, UINT32 *len);
RET_CODE fetch_sys_pub_key(UINT32 target_flag); 
RET_CODE get_sys_pub_key(PK_POS target, UINT8 *pk,UINT32 len);
RET_CODE Test_RSA_Ram(const UINT32 addr, const UINT32 len);   
#endif
